﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xss.Data.Common.SessionStore;
using System.Data;
using Xss.Data.Common;

namespace Xss.Data
{
    /// <summary>
    /// 数据会话
    /// </summary>
    public interface IAdoSession : IDisposable
    {
        /// <summary>
        /// 会话编号
        /// </summary>
        string SessionId { get; }

        /// <summary>
        /// 数据请求
        /// </summary>
        IAdoRequest Request { get; }

        /// <summary>
        /// 数据响应
        /// </summary>
        IAdoResponse Response { get; }

        /// <summary>
        /// 打开会话
        /// </summary>
        void OpenSession();

        /// <summary>
        /// 关闭会话
        /// </summary>
        void Close();

        /// <summary>
        /// 打开数据连接
        /// </summary>
        /// <returns></returns>
        IDbConnection OpenConnection();

        /// <summary>
        /// 数据连接提供
        /// </summary>
        IDbProvider DbProvider { get; }

        /// <summary>
        /// 数据访问控制
        /// </summary>
        IAdoHolder Holder { get; }

        /// <summary>
        /// 数据源定义
        /// </summary>
        IDbSource Source { get; }
    }
}
